package com.scetoop.bank;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class Customer {
    private String firstName;
    private String lastName;
    //private Account [] accounts;
    //private int numberOfaccounts;

    private List<Account> accounts;
    public Customer(String f, String l) {
        this.firstName = f;
        this.lastName = l;

        //accounts = new Account[2];
        accounts = new ArrayList<>();
    }

    public String getFirstName() {
        return firstName;
    }

    public String getLastName(){
        return lastName;
    }

    public void addAccount(Account account) {
        //accounts[numberOfaccounts++] = account;
        accounts.add(account);
    }

    public Account getAccount(int index){
       // return accounts[index];
        return accounts.get(index);
    }

    public int getNumberOfaccounts(){
       // return numberOfaccounts;
        return accounts.size();

    }
    public Iterator<Account> getAccounts(){
        return accounts.iterator();

    }
}